// 引入模拟数据库 mock
import Mock from 'mockjs'


function getRecord() {
    const res = []
    for (let index = 0; index < 31; index++) {
        const data = {
            'adtStatue|1-6': 1,
            day: 20210801 + index,
            id: '@guid'
        }
        res.push(data)
    }
    return res
}


function getData() {
    return Mock.mock({
        code: 1000,
        success: true,
        message: '获取成功',
        data: {
            total: 50,
            'rows|50': [
                {
                    'id': '@guid',
                    'username': '@cname',
                    'workNumber|10000001-99999999': 1,
                    'departmentName|1': ['总裁办', '行政部', '人事部', '财务部', '技术部', '运营部', '市场部', '财务核算部', '税务管理部', '薪资管理部', 'Java研发部', 'Python研发部', 'Php研发部', '北京事业部', '上海事业部'],
                    'mobile|18000000000-18999999999': 1,
                    attendanceRecord: getRecord()
                }
            ]
        }
    })
}

Mock.mock('/api/mock/attendances', 'get', getData())